/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.active;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BIN;

/**
 * <b>(DianlanRemoteStartCharge)</b>
 * <p>
 * 远程控制启机
 * 当客户通过远程启动充电时，发送本命令
 * 帧类型码 0x34
 * 序列号域 007C
 * 数据长度 30(48)
 * 帧校验域 4622
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/11
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanRemoteStartCharge {
    /** 交易流水号 */
    @DianlanProtocol(length = 16, start = 0, end = 16, dataType = BCD)
    String transNo;
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 16, end = 23, dataType = BCD)
    String stubNo;
    /** 充电枪号 */
    @Builder.Default
    @DianlanProtocol(length = 1, start = 23, end = 24, dataType = BCD)
    String chargingPortNo = "01";
    /** 逻辑卡号 显示在屏幕上，不足 8 位补零 */
    @DianlanProtocol(length = 8, start = 24, end = 32, dataType = BCD)
    String logicCardNo;
    /** 物理卡号 显示在屏幕上，不足 8 位补零 */
    @Builder.Default
    @DianlanProtocol(length = 8, start = 32, end = 40, dataType = BIN)
    String physicsCardNo  = "0000000000000001";
    /** 账户余额 保留两位小数 */
    @DianlanProtocol(length = 4, start = 40, end = 44, dataType = BIN)
    String balance;
}